package com.cmcc.driver.util

import com.google.android.gms.maps.model.LatLng

/**
 * Author: jiangxin
 * Date: 2019/11/12
 * Description:
 */
class LocationUtil {

    fun setCurrentLoc(location:LatLng){
        currentLocation =location
    }

    fun getCurrentLoc(): LatLng? {
        return currentLocation
    }


    companion object {
        private var currentLocation: LatLng = LatLng(0.0,0.0)

        private var instance: LocationUtil? = null

        private val `object` = Any()

        fun getInstance(): LocationUtil {
            if (instance == null) {
                synchronized(`object`) {
                    if (instance == null) {
                        instance = LocationUtil()
                    }
                }
            }
            return instance!!
        }
    }
}